import KZJRequest from '../../index'
import { TRequestDefaultResult } from '../../type'

enum Anchor {
  Swipers = '/dj/banner', //电台轮播图
  Category = '/dj/catelist', //分类导航图标
  Recommd = '/dj/recommend', //精选电台
  Pays = '/dj/paygift', //付费电台
  Detail = '/dj/detail', //电台详情
  TypeAnchor = '/dj/recommend/type' //不同类型电台数据
}

export function getAnchorSwiper() {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.Swipers
  })
}

export function getCategoryNav() {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.Category
  })
}

export function getRecommd() {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.Recommd
  })
}

export function getPays(limit = 4) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.Pays,
    params: {
      limit
    }
  })
}

export function getAnchorDetail(rid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.Detail,
    params: {
      rid
    }
  })
}

export function getTypeAnchors(typeid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Anchor.TypeAnchor,
    params: {
      type: typeid
    }
  })
}
